package com.exartisan.adapter;

import com.actionbarsherlock.app.SherlockFragment;
import com.exartisan.fragment.GalleryFragment;
import com.exartisan.fragment.HomeFragment;
import com.exartisan.fragment.NewEventFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class HomePagerAdapter extends FragmentPagerAdapter {

	public HomePagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int pos) {
		switch (pos) {
		case 0:
			return new HomeFragment();
		case 1:
			return new NewEventFragment();
		case 2:
			return new GalleryFragment(); 
		default:
			return new SherlockFragment();
		}
	}

	@Override
	public int getCount() {
		return 3;
	}
	
	@Override
	public CharSequence getPageTitle(int pos) {
		switch (pos) {
		case 0:
			return "Nổi bật";
		case 1:
			return "Sự kiện mới";
		case 2:
			return "Gallery"; 
		default:
			return "";
		}
	}

}
